home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qprogressbar.h.z / qprogressbar.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  1.9 KB  |  80 lines

  1. /****************************************************************************
  2. ** $Id: qprogressbar.h,v 2.10 1998/07/03 00:09:52 hanord Exp $
  3. **
  4. ** Definition of QProgressBar class
  5. **
  6. ** Created : 970520
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QPROGRESSBAR_H
  25. #define QPROGRESSBAR_H
  26.  
  27. #ifndef QT_H
  28. #include "qframe.h"
  29. #endif // QT_H
  30.  
  31.  
  32. class QProgressBar : public QFrame
  33. {
  34.     Q_OBJECT
  35. public:
  36.     QProgressBar( QWidget *parent=0, const char *name=0, WFlags f=0 );
  37.     QProgressBar( int totalSteps, QWidget *parent=0, const char *name=0,
  38.           WFlags f=0 );
  39.  
  40.     int        totalSteps() const;
  41.     int        progress()   const;
  42.  
  43.     QSize    sizeHint() const;
  44.     void    show();
  45.  
  46. public slots:
  47.     void    reset();
  48.     void    setTotalSteps( int totalSteps );
  49.     void    setProgress( int progress );
  50.  
  51. protected:
  52.     void    drawContents( QPainter * );
  53.     virtual bool setIndicator( QString& progress_str, int progress,
  54.                    int totalSteps );
  55.  
  56. private:
  57.     int        total_steps;
  58.     int        progress_val;
  59.     int        percentage;
  60.     QString    progress_str;
  61.  
  62. private:    // Disabled copy constructor and operator=
  63.     QProgressBar( const QProgressBar & );
  64.     QProgressBar &operator=( const QProgressBar & );
  65. };
  66.  
  67.  
  68. inline int QProgressBar::totalSteps() const
  69. {
  70.     return total_steps;
  71. }
  72.  
  73. inline int QProgressBar::progress() const
  74. {
  75.     return progress_val;
  76. }
  77.  
  78.  
  79. #endif // QPROGRESSBAR_H
  80.